.PHONY: clean prepare build

TARGET= doors
BUILD= Build

CPP= g++-4.1
all release: CPPFLAGS= -Wall -Wno-non-virtual-dtor -Os -g0
debug: CPPFLAGS= -Wall -Wno-non-virtual-dtor -O0 -g2
LINKFLAGS= 
LIBS=

INCLUDE= -I include 
vpath %.cpp src 
vpath %.o $(BUILD)
SRC =  color.cpp subject.cpp door.cpp person.cpp
SRC += category.cpp catdoors.cpp catpeople.cpp 
SRC += expression.cpp expdoors.cpp exppeople.cpp
SRC += mutator.cpp doormutator.cpp peoplemutator.cpp globalmutator.cpp main.cpp
SRC_PATH= $(addprefix src/, $(SRC))

all release debug: prepare $(TARGET)

$(TARGET): $(SRC)
	$(CPP) $(CPPFLAGS) $(INCLUDE) $(LINKFLAGS) $(LIBS) $(SRC_PATH) -o ./$(BUILD)/$(TARGET)

prepare:
	mkdir $(BUILD) || true

clean:
	rm $(BUILD)/$(TARGET) $(BUILD)/*.o
